﻿using System;
class ProgrWhichIsGreateram
{
    static void Main()
    {
        int[] numbers;
        numbers = new int[5];
        int largestnum = 0;
        Console.WriteLine("Please inter five integers: ");
        while (true)
        {
            try
            {
                numbers[0] = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter number: ");
            }
        }
        while (true)
        {
            try
            {
                numbers[1] = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter number: ");
            }
        }
        while (true)
        {
            try
            {
                numbers[2] = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter number: ");
            }
        }
        while (true)
        {
            try
            {
                numbers[3] = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter number: ");
            }
        }
        while (true)
        {
            try
            {
                numbers[4] = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter number: ");
            }
        }
        Console.WriteLine("Enterd numbers are: {0}, {1}, {2}, {3}, {4}", numbers[0], numbers[1], numbers[2], numbers[3], numbers[4]);
        Console.ReadLine();
        for (int i = 0; i < 5; i++)
        {
            if (numbers[i] > largestnum)
            {
                largestnum = numbers[i];
            }
        }
        Console.WriteLine("The largest number is: {0}", largestnum);
        Console.ReadLine();
    }
}

